A 12-slice pizza was made with only pepperoni and mushroom toppings, and every slice has at least one topping. Only six slices have pepperoni, and exactly ten slices have mushrooms. How many slices have both pepperoni and mushrooms?
Explanation: There are 12 total slices, and 6 of them have pepperoni and 10 have mushrooms. Let $n$ be the number of the slices that have both toppings, so there are $6-n$ with just pepperoni and $10-n$ with just mushrooms.  Since every slice has at least one topping, and there are 12 slices, we must have $(6-n) + (10-n) + n = 12$, which gives $n=\boxed{4}$.